#集合相关函数操作
def p(p):
	print(p)

#add()
set1 = {1,2,3,4,5,6,7,8}
set1.add("A")		#最后追加一个A


#pop()	 &  remove()    &  discard()

set2 = {'红红',"兰兰",'静静','吉吉'}

#移除最后一个元素
#res = set2.pop()

#移除指定的一个
#res = set2.remove('兰兰')

#移除指定的一个
res = set2.discard('静静')

#清空clear()
#res = set2.clear()


#copy()
set3 = {"阿萨德",'阿斯达','打算','双方都'}
set4 = set3.copy()
# p(set4)



#集合运算函数
#difference()差集    除去相同的就是差集
setn = {'黄土','高坡','涂泥'}
setm = {'斗破','高坡','拦你'}

res = setn.difference(setm)



#差集更新  difference_update()

seta = {'黄土','高坡','盆地','黑土'}
setb = {'蓝山','被迫','盆地','黑土'}

res = seta.difference_update(setb)



#超集子集运算
set1 = {'蓝天','白云','农妇','山泉','田'}

set2 = {'农妇','山泉'}


result = set1.issuperset(set2)
print(result)


#非相交集合

set1 = {1,2,3,4,5,6,7}

set2 = {'A','B','C','D',2}

result = set1.isdisjoint(set2)

print(result)


#p(res)


